package website.lucaswork.survey.core.daos;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import website.lucaswork.survey.core.entities.Survey;
import website.lucaswork.survey.core.entities.User;

@Repository
public interface SurveyRepository extends JpaRepository<Survey, Integer> {
	Survey findBySlug(String slug);
	Survey findByTitleAndUser(String title, User user);
	Page<Survey> findAll(Pageable pageable);
	Page<Survey> findByTitleContainingOrDescriptionContaining(String title, String desc, Pageable pageable);
}
